﻿using BaseDll;
using CommonTools;
using HY_UPHMgr;
using ModuleUnit;
using MotionIoLib;
using Newtonsoft.Json.Linq;
using OtherDevice;
using StationCommunication;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data.SqlClient;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices.ComTypes;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Linq;
using UserData;
using static UserData.Control_ScrewData;
using TestResult = UserData.TestResult;

namespace StationDemo
{
    public class Param_标定
    {

        public ParamSet 键盘模式 = new ParamSet()
        {
            _enuValType = ParamSetUnit.boolUnit,
            _strParamUnit = "键盘模式",
            _strParamValMax = true,
            _strParamValMin = false,
            _strParamVal = false,
            _ParamRight = UserRight.Operator,
            _ParamClass = "综合",
            b_IsStartCheck = true,
        };
        public ParamSet b_是否烧录 = new ParamSet()
        {
            _enuValType = ParamSetUnit.boolUnit,
            _strParamUnit = "b_是否烧录",
            _strParamValMax = true,
            _strParamValMin = false,
            _strParamVal = true,
            _ParamRight = UserRight.Operator,
            _ParamClass = "综合",
            b_IsStartCheck = true,
        };


        public ParamSet 扫码超时时间 = new ParamSet()
        {
            _enuValType = ParamSetUnit.intUnit,
            _strParamUnit = "扫码超时时间",
            _strParamValMax = 600000,
            _strParamValMin = 0,
            _strParamVal = 60000,
            _ParamRight = UserRight.Operator,
            _ParamClass = "综合",
            b_IsStartCheck = true,
        };
        public ParamSet 烧录超时时间 = new ParamSet()
        {
            _enuValType = ParamSetUnit.intUnit,
            _strParamUnit = "烧录超时时间",
            _strParamValMax = 600000,
            _strParamValMin = 0,
            _strParamVal = 60000,
            _ParamRight = UserRight.Operator,
            _ParamClass = "综合",
            b_IsStartCheck = true,
        };
        public ParamSet 标定计算超时时间 = new ParamSet()
        {
            _enuValType = ParamSetUnit.intUnit,
            _strParamUnit = "标定计算超时时间",
            _strParamValMax = 600000,
            _strParamValMin = 0,
            _strParamVal = 60000,
            _ParamRight = UserRight.Operator,
            _ParamClass = "综合",
            b_IsStartCheck = true,
        };

        public ParamSet 轴到位后延时 = new ParamSet()
        {
            _enuValType = ParamSetUnit.intUnit,
            _strParamUnit = "轴到位后延时",
            _strParamValMax = 600000,
            _strParamValMin = 0,
            _strParamVal = 500,
            _ParamRight = UserRight.Operator,
            _ParamClass = "综合",
            b_IsStartCheck = true,
        };

        public ParamSet 取图数量 = new ParamSet()
        {
            _enuValType = ParamSetUnit.intUnit,
            _strParamUnit = "取图数量",
            _strParamValMax = 30,
            _strParamValMin = 0,
            _strParamVal = 15,
            _ParamRight = UserRight.Operator,
            _ParamClass = "综合",
            b_IsStartCheck = true,
        };
        public ParamSet 是否对心 = new ParamSet()
        {
            _enuValType = ParamSetUnit.boolUnit,
            _strParamUnit = "是否对心",
            _strParamValMax = true,
            _strParamValMin = false,
            _strParamVal = false,
            _ParamRight = UserRight.Operator,
            _ParamClass = "综合",
            b_IsStartCheck = true,
        };
        //public ParamSet 是否使用绝对位置拍图 = new ParamSet()
        //{
        //    _enuValType = ParamSetUnit.boolUnit,
        //    _strParamUnit = "是否使用绝对位置拍图",
        //    _strParamValMax = true,
        //    _strParamValMin = false,
        //    _strParamVal = false,
        //    _ParamRight = UserRight.Operator,
        //    _ParamClass = "综合",
        //    b_IsStartCheck = true,
        //};
        public ParamSet 测试图片张数 = new ParamSet()
        {
            _enuValType = ParamSetUnit.intUnit,
            _strParamUnit = "测试图片张数",
            _strParamValMax = 20,
            _strParamValMin = 1,
            _strParamVal = 1,
            _ParamRight = UserRight.Operator,
            _ParamClass = "综合",
            b_IsStartCheck = true,
        };
        public ParamSet 测试图片行数 = new ParamSet()
        {
            _enuValType = ParamSetUnit.intUnit,
            _strParamUnit = "测试图片行数",
            _strParamValMax = 20,
            _strParamValMin = 1,
            _strParamVal = 1,
            _ParamRight = UserRight.Operator,
            _ParamClass = "综合",
            b_IsStartCheck = true,
        };
        public ParamSet 测试图片列数 = new ParamSet()
        {
            _enuValType = ParamSetUnit.intUnit,
            _strParamUnit = "测试图片列数",
            _strParamValMax = 20,
            _strParamValMin = 1,
            _strParamVal = 1,
            _ParamRight = UserRight.Operator,
            _ParamClass = "综合",
            b_IsStartCheck = true,
        };
        public ParamSet 横移间隔_度 = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "横移间隔_度",
            _strParamValMax = 20,
            _strParamValMin = 0,
            _strParamVal = 1,
            _ParamRight = UserRight.Operator,
            _ParamClass = "综合",
            b_IsStartCheck = true,
        };
        public ParamSet 纵移间隔_度 = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "纵移间隔_度",
            _strParamValMax = 20,
            _strParamValMin = 0,
            _strParamVal = 1,
            _ParamRight = UserRight.Operator,
            _ParamClass = "综合",
            b_IsStartCheck = true,
        };
        public ParamSet X_gain = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "X_gain",
            _strParamValMax = 20,
            _strParamValMin = 0,
            _strParamVal = 1,
            _ParamRight = UserRight.Operator,
            _ParamClass = "对心",
            b_IsStartCheck = true,
        };
        public ParamSet Y_gain = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "Y_gain",
            _strParamValMax = 20,
            _strParamValMin = 0,
            _strParamVal = 1,
            _ParamRight = UserRight.Operator,
            _ParamClass = "对心",
            b_IsStartCheck = true,
        };
        public ParamSet X方向是否对称 = new ParamSet()
        {
            _enuValType = ParamSetUnit.boolUnit,
            _strParamUnit = "X方向是否对称",
            _strParamValMax = true,
            _strParamValMin = false,
            _strParamVal = false,
            _ParamRight = UserRight.Operator,
            _ParamClass = "对心",
            b_IsStartCheck = true,
        };
        public ParamSet Y方向是否对称 = new ParamSet()
        {
            _enuValType = ParamSetUnit.boolUnit,
            _strParamUnit = "Y方向是否对称",
            _strParamValMax = true,
            _strParamValMin = false,
            _strParamVal = false,
            _ParamRight = UserRight.Operator,
            _ParamClass = "对心",
            b_IsStartCheck = true,
        };
        public ParamSet d_对心最大偏差 = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "d_对心最大偏差",
            _strParamValMax = 1,
            _strParamValMin = 0.1,
            _strParamVal = 0.2,
            _ParamRight = UserRight.Operator,
            _ParamClass = "对心",
            b_IsStartCheck = true,
        };
        public ParamSet d_Tx轴负限 = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "d_Tx轴负限",
            _strParamValMax = 1,
            _strParamValMin = 0.1,
            _strParamVal = 0.2,
            _ParamRight = UserRight.Operator,
            _ParamClass = "对心",
            b_IsStartCheck = true,
        };

        public ParamSet d_Tx轴正限 = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "d_Tx轴正限",
            _strParamValMax = 1,
            _strParamValMin = 0.1,
            _strParamVal = 0.2,
            _ParamRight = UserRight.Operator,
            _ParamClass = "对心",
            b_IsStartCheck = true,
        };
        public ParamSet d_Ty轴负限 = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "d_Ty轴负限",
            _strParamValMax = 1,
            _strParamValMin = 0.1,
            _strParamVal = 0.2,
            _ParamRight = UserRight.Operator,
            _ParamClass = "对心",
            b_IsStartCheck = true,
        };

        public ParamSet d_Ty轴正限 = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "d_Ty轴正限",
            _strParamValMax = 1,
            _strParamValMin = 0.1,
            _strParamVal = 0.2,
            _ParamRight = UserRight.Operator,
            _ParamClass = "对心",
            b_IsStartCheck = true,
        };
        #region 标定规格
        public ParamSet d_Current_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "电流最小值",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "电流规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet d_Current_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "电流最大值",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 1,
            _ParamRight = UserRight.Operator,
            _ParamClass = "电流规格设置",
            b_IsStartCheck = true,
        };

        public ParamSet d_Voltage_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "电压最小值",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "电流规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet d_Voltage_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "电压最大值",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 12,
            _ParamRight = UserRight.Operator,
            _ParamClass = "电流规格设置",
            b_IsStartCheck = true,
        };


        public ParamSet 平均重投影_MAX = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "平均重投影_MAX",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet 平均重投影_MIN = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "平均重投影_MIN",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet 最大重投影_MAX = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "最大重投影_MAX",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet 最大重投影_MIN = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "最大重投影_MIN",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet 覆盖率_MAX = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "覆盖率_MAX",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet 覆盖率_MIN = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "覆盖率_MIN",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };

        public ParamSet Cx_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "Cx_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet Cx_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "Cx_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };

        public ParamSet Cy_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "Cy_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet Cy_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "Cy_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet fx_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "fx_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet fx_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "fx_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet fy_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "fy_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet fy_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "fy_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet k0_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "k0_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet k0_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "k0_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };

        public ParamSet k1_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "k1_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet k1_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "k1_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };

        public ParamSet k2_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "k2_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet k2_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "k2_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet k3_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "k3_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet k3_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "k3_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet k4_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "k4_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet k4_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "k4_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };

        public ParamSet k5_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "k5_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet k5_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "k5_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };

        public ParamSet p0_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "p0_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet p0_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "p0_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet p1_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "p1_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet p1_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "p1_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };


    
        public ParamSet PolyCoeffs1_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "PolyCoeffs1_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet PolyCoeffs1_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "PolyCoeffs1_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet PolyCoeffs2_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "PolyCoeffs2_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet PolyCoeffs2_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "PolyCoeffs2_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet PolyCoeffs3_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "PolyCoeffs3_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet PolyCoeffs3_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "PolyCoeffs3_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet PolyCoeffs4_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "PolyCoeffs4_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet PolyCoeffs4_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "PolyCoeffs4_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet PolyCoeffs5_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "PolyCoeffs5_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet PolyCoeffs5_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "PolyCoeffs5_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };



        public ParamSet InvPoly1_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPolys1_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly1_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPoly1_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly2_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPolys2_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly2_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPoly2_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };

        public ParamSet InvPoly3_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPolys3_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly3_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPoly3_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };

        public ParamSet InvPoly4_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPolys4_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly4_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPoly4_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly5_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPolys5_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly5_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPoly5_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly6_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPolys6_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly6_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPoly6_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly7_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPolys7_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly7_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPoly7_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly8_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPolys8_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly8_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPoly8_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly9_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPolys9_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly9_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPoly9_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly10_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPolys10_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly10_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPoly10_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly11_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPolys11_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly11_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPoly11_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly12_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPolys12_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly12_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPoly12_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly13_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPolys13_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly13_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPoly13_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly14_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPolys14_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly14_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPoly14_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly15_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPolys15_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly15_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPoly15_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly16_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPolys16_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly16_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPoly16_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly17_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPolys17_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly17_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPoly17_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };

        public ParamSet InvPoly18_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPolys18_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly18_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPoly18_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly19_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPolys19_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly19_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPoly19_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };

        public ParamSet InvPoly20_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPolys20_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet InvPoly20_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "InvPoly20_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };



        public ParamSet AffineParas1_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "AffineParas1_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet AffineParas1_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "AffineParas1_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet AffineParas2_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "AffineParas2_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet AffineParas2_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "AffineParas2_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet AffineParas3_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "AffineParas3_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet AffineParas3_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "AffineParas3_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet AffineParas4_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "AffineParas4_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet AffineParas4_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "AffineParas4_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet AffineParas5_Max = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "AffineParas5_Max",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };
        public ParamSet AffineParas5_Min = new ParamSet()
        {
            _enuValType = ParamSetUnit.doubleUnit,
            _strParamUnit = "AffineParas5_Min",
            _strParamValMax = 999,
            _strParamValMin = 0,
            _strParamVal = 0,
            _ParamRight = UserRight.Operator,
            _ParamClass = "标定规格设置",
            b_IsStartCheck = true,
        };



        #endregion





    }
    public class Point_标定
    {
        public PointInfo 安全位置 = new PointInfo(0, 0, 0, 0, 0, 0, UserRight.Operator, "综合");
        public PointInfo 上下料位置 = new PointInfo(0, 0, 0, 0, 0, 0, UserRight.Operator, "综合");

        public PointInfo 标定初始位置 = new PointInfo(0, 0, 0, 0, 0, 0, UserRight.Operator, "综合");
        public PointInfo 标定测试位置1 = new PointInfo(0, 0, 0, 0, 0, 0, UserRight.Operator, "综合");
        public PointInfo 标定测试位置2 = new PointInfo(0, 0, 0, 0, 0, 0, UserRight.Operator, "综合");
        public PointInfo 标定测试位置3 = new PointInfo(0, 0, 0, 0, 0, 0, UserRight.Operator, "综合");
        public PointInfo 标定测试位置4 = new PointInfo(0, 0, 0, 0, 0, 0, UserRight.Operator, "综合");

        public PointInfo 标定测试位置5 = new PointInfo(0, 0, 0, 0, 0, 0, UserRight.Operator, "综合");

        public PointInfo 标定测试位置6 = new PointInfo(0, 0, 0, 0, 0, 0, UserRight.Operator, "综合");
        public PointInfo 标定测试位置7 = new PointInfo(0, 0, 0, 0, 0, 0, UserRight.Operator, "综合");


        public PointInfo 标定测试位置8 = new PointInfo(0, 0, 0, 0, 0, 0, UserRight.Operator, "综合");
        public PointInfo 标定测试位置9 = new PointInfo(0, 0, 0, 0, 0, 0, UserRight.Operator, "综合");
        public PointInfo 标定测试位置10 = new PointInfo(0, 0, 0, 0, 0, 0, UserRight.Operator, "综合");
        public PointInfo 标定测试位置11 = new PointInfo(0, 0, 0, 0, 0, 0, UserRight.Operator, "综合");
        public PointInfo 标定测试位置12 = new PointInfo(0, 0, 0, 0, 0, 0, UserRight.Operator, "综合");
        public PointInfo 标定测试位置13 = new PointInfo(0, 0, 0, 0, 0, 0, UserRight.Operator, "综合");
        public PointInfo 标定测试位置14 = new PointInfo(0, 0, 0, 0, 0, 0, UserRight.Operator, "综合");
        public PointInfo 标定测试位置15 = new PointInfo(0, 0, 0, 0, 0, 0, UserRight.Operator, "综合");


    }
    public class Config_标定
    {


        [Category("工站参数"), DisplayName("1.扫码枪"), Description("扫码枪")]
        public string str_扫码枪 { set; get; } = "";
        [Category("工站参数"), DisplayName("1.NG盒"), Description("NG盒")]
        public string str_NG盒 { set; get; } = "";

    }

  



    public class Station_标定 : CommonTools.StationbaseEx<Param_标定, Point_标定, Config_标定>
    {

        public Station_标定(CommonTools.Stationbase station, Param_标定 param, Point_标定 point, Config_标定 config) : base(station, param, point, config)
        {

        }
        #region 参数定义
        string  strError = "";
        ResultDataBase testResult = new ResultDataBase();
      
        DateTime date_BeginTime = DateTime.Now;
        DateTime uph_BeginTime = DateTime.Now;

        SNScan_Base 扫码枪
        {
            get 
            {
                return DeviceMgr.GetInstance().Function_获取串口(station_Config.str_扫码枪) as Scan_NLSFM430;
            }
        
        }

        ClylinerBase ClylinerBase_NG盒
        {
            get
            {
                return DeviceMgr.GetInstance().Function_获取气缸(station_Config.str_NG盒) as ClylinerBase;
            }

        }

        public enum StationStep
        {
            [Description("0.初始化步骤")]
            Step_Init = 100,
            [Description("1.扫码")]
            Step_扫码,
            [Description("2.启动")]
            Step_启动,
            [Description("3.点亮")]
            Step_点亮,
            [Description("4.取图")]
            Step_取图,
            [Description("5.标定测试")]
            Step_Test,
            [Description("6.烧录")]
            Step_烧录,
            [Description("6.下料")]
            Step_下料,
            [Description("14.结束流程")]
            Step_End,
            [Description("15.NG停止流程")]
            Step_NG,
        }
        #endregion

        #region 主流程
        protected override void StationWork(int step)
        {
            try
            {
                if (Param_System.Instance.b_是否开启三角测量._strParamVal)
                {
                    return;
                }

                switch (step)
                {
                    case (int)StationStep.Step_Init:
                        DelCurrentStep();
                        PushMultStep((int)StepInitRun());
                        break;
                    case (int)StationStep.Step_扫码:
                        DelCurrentStep();
                        PushMultStep((int)Step_扫码());
                        break;
                    case (int)StationStep.Step_启动:
                        DelCurrentStep();
                        PushMultStep((int)Step_启动());
                        break;
                    case (int)StationStep.Step_点亮:
                        DelCurrentStep();
                        PushMultStep((int)Step_点亮());
                        break;
                    case (int)StationStep.Step_取图:
                        DelCurrentStep();
                        PushMultStep((int)Step_取图());
                        break;
                    case (int)StationStep.Step_Test:
                        DelCurrentStep();
                        PushMultStep((int)Step_Test());
                        break;
                    case (int)StationStep.Step_烧录:
                        DelCurrentStep();
                        PushMultStep((int)Step_烧录());
                        break;
                    case (int)StationStep.Step_下料:
                        DelCurrentStep();
                        PushMultStep((int)Step_下料());
                        break;
                    case (int)StationStep.Step_End:
                        DelCurrentStep();
                        PushMultStep((int)StepEnd());
                        Thread.Sleep(10);
                        break;
                    case (int)StationStep.Step_NG:
                        DelCurrentStep();
                        PushMultStep((int)StepNG());
                        Thread.Sleep(10);
                        break;
                }
            }
            catch (Exception ex)
            {
                LogHelper.OnTest_ShowLog(Name, $"{Name} 发生错误:{ex.StackTrace},{ex.Message}", LogType.Err);
                StationMgr.GetInstance().Stop();
            }
        }
        protected override bool InitStation()
        {
           // ProductDataShow.OnTest_ShowProductData(testResult);

         //   LoadSeverMgr.Instance.Start();

            ClearAllStep();
            PushMultStep((int)StationStep.Step_Init);
            return true;
        }
        public override void PauseDeal()
        {
           
        }
        public override void ResumeDeal()
        {

        }
        public override void StopDeal()
        {

        }

        #endregion


        #region  方法

        public StationStep StepInitRun(bool bmanual = false)
        {
            

            StationStateHelper.OnTest_ShowStep(Name, "已启动测试", LogType.Info);
            Function_运动到点位(station_Point.上下料位置, bmanual);
            return StationStep.Step_扫码;
        }

        public StationStep Step_扫码(bool bmanual = false)
        {
            GlobalVariable.启用安全光栅 = false;
            StationStateHelper.OnTest_ShowStep(Name, "请扫码", LogType.Info);
            LogHelper.OnTest_ShowLog(Name, $"请扫码", LogType.Info);
            string SN = "";
            strError = "";
            Form_Auto.ShowSN("");
            if (!Function_扫码(ref SN))
            {
                return StationStep.Step_扫码;
            }
            
            LogHelper.OnTest_ShowLog(Name, $"SN为:{SN}", LogType.Info);


            testResult = new ResultDataBase();
            Function_设置标定参数规格(ref testResult);
           
            testResult.str_外壳SN.Value = SN;
            return StationStep.Step_启动;
        }
        public StationStep Step_启动(bool bmanual = false)
        {

            StationStateHelper.OnTest_ShowStep(Name, "请上料，并按双启动按钮", LogType.Info);
            LogHelper.OnTest_ShowLog(Name, $"请上料，并按双启动按钮", LogType.Info);
          
            Stopwatch stopwatch = new Stopwatch();
            stopwatch.Start();
            while (true && sys.g_AppMode != AppMode.AirRun)
            {
                if (IOMgr.GetInstace().Function_ReCheckIO(IO_IN.双启动信号.ToString(), true, 100))
                {
                    IO_OUT.双启动指示灯.Set(false);
                    LoadSeverMgr.Instance.Functio_停止取图();
                    LoadSeverMgr.Instance.Function_清空标定数据();
                    break;
                }
                Thread.Sleep(1);
                if (stopwatch.ElapsedMilliseconds > 200)
                {
                    IO_OUT.双启动指示灯.Set(!IO_OUT.双启动指示灯.Get());
                }
            }
            if (sys.g_AppMode == AppMode.AirRun)
            {
                for (int i = 0; i < 3; i++)
                {
                    IO_OUT.双启动指示灯.Set(true);
                    Thread.Sleep(100);
                    IO_OUT.双启动指示灯.Set(false);
                    Thread.Sleep(100);
                }
            }
            GlobalVariable.启用安全光栅 = true;
            return StationStep.Step_点亮;
        }
        public StationStep Step_点亮(bool bmanual = false)
        {
            StationStateHelper.OnTest_ShowStep(Name, "开始点亮", LogType.Info);
            LogHelper.OnTest_ShowLog(Name, $"开始点亮", LogType.Info);
            if (sys.g_AppMode != AppMode.AirRun)
            {
                //点亮
                int count = 0;
            re:
                double voltage = 0.0;
                double current = 0.0;
                if (!LoadSeverMgr.Instance.Function_点亮(testResult.str_外壳SN.Value, ref voltage, ref current))
                {
                    LogHelper.OnTest_ShowLog(Name, $"第{count + 1}次点亮失败", LogType.Info);

                    if (count < 3)
                    {
                        count++;
                        goto re;
                    }
                    strError = $"{NGType.点亮}";
                    testResult.Result.Value = false;
                    LogHelper.OnTest_ShowLog(Name, $"点亮失败", LogType.Err);
                    StationStateHelper.OnTest_ShowStep(Name, "点亮失败", LogType.Err);
                    return StationStep.Step_下料;
                }
                testResult.Current.Value = current;
                testResult.Voltage.Value = voltage;
                LogHelper.OnTest_ShowLog(Name, $"点亮成功", LogType.Info);
            }
            else
            {

                StationStateHelper.OnTest_ShowStep(Name, "空跑，已屏蔽点亮", LogType.Info);
                LogHelper.OnTest_ShowLog(Name, $"空跑，已屏蔽点亮", LogType.Info);
            }
            return StationStep.Step_取图;
        }


        public StationStep Step_取图(bool bmanual = false)
        {
            StationStateHelper.OnTest_ShowStep(Name, "运动到标定yuan", LogType.Info);
            LogHelper.OnTest_ShowLog(Name, $"开始获取标定数据", LogType.Info);
            Function_运动到点位(station_Point.标定初始位置, bmanual);

            if (!Function_执行对心())
            {
                strError = $"{NGType.对心}";
                testResult.Result.Value = false;
                return StationStep.Step_下料;
            }
            if (!station_Param.是否对心._strParamVal)
            {
                int Framenum = station_Param.取图数量._strParamVal;
                FieldInfo[] fields = station_Point.GetType().GetFields();
                for (int i = 1; i <= Framenum; i++)
                {
                    foreach (FieldInfo temp in fields)
                    {
                        if (temp.Name == $"标定测试位置{i}")
                        {
                            StationStateHelper.OnTest_ShowStep(Name, $"{Name}：取第{i}张图", LogType.Info);
                            PointInfo pointInfo = (PointInfo)temp.GetValue(station_Point);
                            LogHelper.OnTest_ShowLog(Name, $"测试位置：{temp.Name} U轴目标位置：{pointInfo.pointU},Tx轴目标位置：{pointInfo.pointTx},Ty轴目标位置：{pointInfo.pointTy}", LogType.Info);
                            Function_运动到点位(pointInfo);
                            Thread.Sleep(station_Param.轴到位后延时._strParamVal);
                            if (!LoadSeverMgr.Instance.Function_取图(i - 1))
                            {
                                strError = $"{NGType.取图}";
                                testResult.Result.Value = false;
                                return StationStep.Step_下料;
                            }


                        }


                    }

                }
                Function_运动到点位(station_Point.标定初始位置, bmanual);
            }
            else
            {
                Thread.Sleep(station_Param.轴到位后延时._strParamVal);
                int bitmapnum = 0;
                if (!LoadSeverMgr.Instance.Function_取图(bitmapnum++))
                {
                    LogHelper.OnTest_ShowLog(Name, $"取图第1张图失败", LogType.Err);

                    strError = $"{NGType.取图}";
                    testResult.Result.Value = false;
                    return StationStep.Step_下料;
                }
                int raw = station_Param.测试图片行数._strParamVal;
                int col = station_Param.测试图片列数._strParamVal;
                double X = MotionMgr.GetInstace().GetAxisActPos(AxisU) - (col / 2) * station_Param.横移间隔_度._strParamVal;
                double Y = MotionMgr.GetInstace().GetAxisActPos(AxisTx) - (raw / 2) * station_Param.纵移间隔_度._strParamVal;
                List<PointInfo> point_all = new List<PointInfo>();
                PointInfo pointInfo = new PointInfo();
                for (int i = 0; i < raw; i++)
                {
                    for (int j = 0; j < col; j++)
                    {
                        if (i == raw / 2 && j == col / 2) continue;
                        pointInfo.pointU = X + j * station_Param.横移间隔_度._strParamVal;
                        pointInfo.pointTx = Y + i * station_Param.纵移间隔_度._strParamVal;
                        LogHelper.OnTest_ShowLog(Name, $" U轴目标位置：{pointInfo.pointU},Tx轴目标位置：{pointInfo.pointTx}", LogType.Info);

                        Function_运动TxTy到点位(pointInfo);
                        Thread.Sleep(station_Param.轴到位后延时._strParamVal);
                        if (!LoadSeverMgr.Instance.Function_取图(bitmapnum++))
                        {
                            LogHelper.OnTest_ShowLog(Name, $"取图第{bitmapnum + 1}张图失败", LogType.Err);


                            strError = $"{NGType.取图}";
                            testResult.Result.Value = false;
                            return StationStep.Step_下料;
                        }
                    }
                }
               
            }
            Function_运动到点位(station_Point.标定初始位置, bmanual);

            return StationStep.Step_Test;
        }

        public StationStep Step_Test(bool bmanual = false)
        {

            StationStateHelper.OnTest_ShowStep(Name, "开始标定测试", LogType.Warn);
            LogHelper.OnTest_ShowLog(Name, $"开始标定测试", LogType.Warn);

            double[] value = null;
            bool b_CalibResult = LoadSeverMgr.Instance.Function_标定计算(out value, station_Param.b_是否烧录._strParamVal,station_Param.标定计算超时时间._strParamVal);
            bool b_DataResult = Function_标定数据结果判定(value, ref strError);
            if (!b_CalibResult)
            {
                strError = NGType.标定测试.ToString();
                testResult.Result.Value = false;
                return StationStep.Step_下料;
            }
            else if (!b_DataResult)
            {
                testResult.Result.Value = false;
                return StationStep.Step_下料;
            }         
          
            LogHelper.OnTest_ShowLog(Name, $"标定测试完成", LogType.Info);
           return StationStep.Step_烧录;
        }

        public StationStep Step_烧录(bool bmanual = false)
        {
            StationStateHelper.OnTest_ShowStep(Name, "开始烧录标定数据", LogType.Info);
            LogHelper.OnTest_ShowLog(Name, $"开始烧录标定数据", LogType.Info);

            if (sys.g_AppMode != AppMode.AirRun)
            {

                if (station_Param.b_是否烧录._strParamVal)
                {

                    bool b_BurnResult = LoadSeverMgr.Instance.Function_烧录(station_Param.烧录超时时间._strParamVal);
                    if (!b_BurnResult)
                    {
                        strError = NGType.烧录失败.ToString();
                        testResult.Result.Value = false;
                        StationStateHelper.OnTest_ShowStep(Name, "烧录失败", LogType.Err);
                        LogHelper.OnTest_ShowLog(Name, "烧录失败", LogType.Err);
                    }
                    else
                    {
                        StationStateHelper.OnTest_ShowStep(Name, "烧录成功", LogType.Err);
                        LogHelper.OnTest_ShowLog(Name, "烧录成功", LogType.Err);
                    }
                }
                else
                {
                    StationStateHelper.OnTest_ShowStep(Name, "烧录已屏蔽", LogType.Err);
                    LogHelper.OnTest_ShowLog(Name, "烧录已屏蔽", LogType.Err);
                }

            }
            else
            {

                StationStateHelper.OnTest_ShowStep(Name, "空跑，已屏蔽烧录标定数据", LogType.Info);
                LogHelper.OnTest_ShowLog(Name, $"空跑，已屏蔽烧录标定数据", LogType.Info);
            }




            return StationStep.Step_下料;
        }



        public StationStep Step_下料(bool bmanual = false)
        {
            StationStateHelper.OnTest_ShowStep(Name, "开始下料", LogType.Info);
            LogHelper.OnTest_ShowLog(Name, $"开始下料", LogType.Info);


            Function_运动到点位(station_Point.上下料位置);
            if (sys.g_AppMode != AppMode.AirRun)
            {
                GlobalVariable.启用安全光栅 = false;

                LoadSeverMgr.Instance.Functio_停止取图();
           //     ProductDataShow.OnTest_ShowProductData(testResult);
                double d_CTTime = (DateTime.Now - date_BeginTime).TotalSeconds;
                double d_uphTime = (DateTime.Now - uph_BeginTime).TotalSeconds;
                date_BeginTime = DateTime.Now;
                uph_BeginTime = DateTime.Now;

              
                if (!testResult.Result.Value)
                {
                    IO_OUT.右指示灯绿.Set(false);
                    IO_OUT.左指示灯绿.Set(false);
                    IO_OUT.右指示灯红.Set(true);
                    IO_OUT.左指示灯红.Set(true);

                    NGCountMgr.GetInstance().AddNGCount(Name, strError);
                    testResult.FailStep.Value = strError;
                  
                    Form_Auto.FlashResult(testResult.FailStep.Value);

                    ClylinerBase_NG盒?.Function_后退();
                    StationStateHelper.OnTest_ShowStep(Name, "请下NG料", LogType.Warn);
                    while (IOMgr.GetInstace().Function_ReCheckIO(IO_IN.NG光栅1.ToString(),false,200) || IOMgr.GetInstace().Function_ReCheckIO(IO_IN.NG光栅2.ToString(), false, 200))
                    {
                        if (Param_System.Instance.是否屏蔽NG盒._strParamVal)
                        {
                            break;
                        }
                        Thread.Sleep(100);
                    }

                    StationStateHelper.OnTest_ShowStep(Name, $"标定完成NG,CT:{d_CTTime.ToString("0.00")}", LogType.Info);
                    LogHelper.OnTest_ShowLog(Name, $"标定完成NG,CT:{d_CTTime.ToString("0.00")}", LogType.Info);
                }
                else
                {
                    IO_OUT.右指示灯红.Set(false);
                    IO_OUT.左指示灯红.Set(false);
                    IO_OUT.右指示灯绿.Set(true);
                    IO_OUT.左指示灯绿.Set(true);
                    Form_Auto.FlashResult("Pass");

                    StationStateHelper.OnTest_ShowStep(Name, $"标定完成OK,CT:{d_CTTime.ToString("0.00")}", LogType.Err);
                    LogHelper.OnTest_ShowLog(Name, $"三角标定完成OK，SN码-{testResult.str_外壳SN.Value},CT:{d_CTTime.ToString("0.00")}", LogType.Err);
                }
                string path = $"D:\\HY System\\结果\\{Param_System.Instance.机型._strParamVal}\\{Param_System.Instance.批次._strParamVal}\\" +
            $"\\{DateTime.Now.ToString("yyyy-MM-dd")}\\标定\\测试数据.csv";
                if (!Directory.Exists(Directory.GetParent(path).FullName))
                {
                    Directory.CreateDirectory(Directory.GetParent(path).FullName);
                }
                CSVHelper.Instance.SaveToCSVPath(path, testResult, true);
                ProductDataShow.OnTest_ShowProductData(testResult);

                if (d_uphTime > Param_System.Instance.正常生产时长限制._strParamVal)
                {
                    TestTimeMgr.GetInstance().Function_AddTestTime("数据统计", 0, testResult.Result.Value);
                }
                else
                {
                    TestTimeMgr.GetInstance().Function_AddTestTime("数据统计", d_uphTime, testResult.Result.Value);
                }
            }
            else
            {
                LogHelper.OnTest_ShowLog(Name, $"空跑，已屏蔽测试", LogType.Info);
            }

            LogHelper.OnTest_ShowLog(Name, $"测试完成", LogType.Info);
            return StationStep.Step_End;
        }

        public StationStep StepEnd(bool bmanual = false)
        {
            StationStateHelper.OnTest_ShowStep(Name, "流程结束", LogType.Info);
            LogHelper.OnTest_ShowLog(Name, $"流程结束", LogType.Info);
           

            return StationStep.Step_扫码;
        }
        public StationStep StepNG(bool bmanual = false)
        {
            StationStateHelper.OnTest_ShowStep(Name, "流程NG", LogType.Info);
            LogHelper.OnTest_ShowLog(Name, $"流程NG", LogType.Info);

            return StationStep.Step_End;
        }
        public bool Function_工站回零()
        {
            StationStateHelper.OnTest_ShowStep(Name, $"正在回零", LogType.Info);
            bool bResult = true;

            Task task_Load_AxisTx = Task.Run(() =>
            {
                try
                {
                    UserDefineFunction.Axis_回零(AxisTx, "Tx轴", this, true);
                }
                catch (Exception)
                {
                    bResult = false;
                }
            });

            Task task_Load_AxisU = Task.Run(() =>
            {
                try
                {
                    UserDefineFunction.Axis_回零(AxisU, "旋转平台", this, true);
                }
                catch (Exception e)
                {
                    bResult = false;
                }
            });

            Task task_Load_AxisTy = Task.Run(() =>
            {
                try
                {
                    UserDefineFunction.Axis_回零(AxisTy, "微动平台", this, true);
                }
                catch (Exception e)
                {
                    bResult = false;
                }
            });


            Task.WaitAll(task_Load_AxisTx, task_Load_AxisU, task_Load_AxisTy);





            StationStateHelper.OnTest_ShowStep(Name, $"回零完成", LogType.Info);
            return bResult;
        }
        public bool Function_气缸复位(bool bmanual = false)
        {

            return true;
        }
        public bool Function_气缸回安全位(bool bmanual = false)
        {

            return true;
        }
        public void Function_运动到点位(PointInfo point, bool bmanual = false)
        {

            MoveMulitAxisPosWaitInpos(new int[] { AxisU, AxisTx, AxisTy }, new double[] { point.pointU, point.pointTx, point.pointTy }, new double[] { (double)SpeedType.High, (double)SpeedType.High, (double)SpeedType.High }, 0.5, bmanual, this);

        }
        public void Function_运动TxTy到点位(PointInfo point, bool bmanual = false)
        {

            MoveMulitAxisPosWaitInpos(new int[] {AxisU, AxisTx}, new double[] { point.pointU, point.pointTx }, new double[] { (double)SpeedType.High, (double)SpeedType.High }, 0.5, bmanual, this);

        }



        public bool Function_扫码(ref string strSN)
        {
            if (sys.g_AppMode == AppMode.AirRun)
            {
                strSN = "空跑";
                return true;
            }
            if (Param_System.Instance.是否屏蔽扫码._strParamVal)
            {
                strSN = DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss");
                return true;
            }
            if (station_Param.键盘模式._strParamVal)
            {
                Stopwatch stopwatch = new Stopwatch();
                stopwatch.Start();
                while (true)
                {
                    if (GlobalVariable.g_StationState == StationState.StationStateEmg)
                        return false;
                     if (UserConfig.b_isScan)
                    {
                        strSN = UserConfig.str_SN;
                        if (strSN == string.Empty || strSN.Length != Param_System.Instance.SN长度._strParamVal || !strSN.Contains(Param_System.Instance.SN固定字符._strParamVal))
                        {
                            AlarmMgr.GetIntance().WarnWithDlg(AlarmList.产品SN校验错误.GetHashCode(), new string[] { "重试" }, new string[] { $"产品SN校验错误，读取内容=[{strSN}]" });

                            return false;
                        }
                        else
                        {

                            LogHelper.OnTest_ShowLog(Name, $"读取产品SN=[{strSN}]", LogType.Info);
                            LogHelper.OnTest_ShowLog(Name, $"等待双按钮启动", LogType.Warn);
                            StationStateHelper.OnTest_ShowStep(Name, $"{Name} 等待双按钮启动", LogType.Warn);
                            break;

                        }
                    }
                    Thread.Sleep(10);
                    if (stopwatch.ElapsedMilliseconds > station_Param.扫码超时时间._strParamVal)
                    {
                        AlarmMgr.GetIntance().WarnWithDlg(AlarmList.等到扫码超时.GetHashCode(), new string[] { "重试" }, new string[] { $"SN读取超时，读取内容=[{strSN}]，请重试" });
                        stopwatch.Restart();
                    }
                }

            }
            else
            {
                if (扫码枪?.Fucntion_获取SN码(Param_System.Instance.SN长度._strParamVal, ref strSN, station_Param.扫码超时时间._strParamVal) == 0)
                {
                    strSN = strSN.Replace("\r","");
                    if (strSN.Contains(Param_System.Instance.SN固定字符._strParamVal))
                    {
                        
                        SNHelper.OnTest_ShowSN("SN", strSN);
                        LogHelper.OnTest_ShowLog(Name, $"读取产品SN=[{strSN}]", LogType.Info);

                        StationStateHelper.OnTest_ShowStep(Name, $"{Name} 等待双按钮启动", LogType.Warn);
                        return true;
                    }
                    else
                    {
                        AlarmMgr.GetIntance().WarnWithDlg(AlarmList.产品SN校验错误.GetHashCode(), new string[] { "重试" }, new string[] { $"产品SN校验错误，读取内容=[{strSN}]" });
                        return false;
                    }

                }
                else
                {
                    AlarmMgr.GetIntance().WarnWithDlg(AlarmList.等到扫码超时.GetHashCode(), new string[] { "重试" }, new string[] { $"SN读取超时，读取内容=[{strSN}]，请重试" });
                    return false;
                }

            }
            return true;

        }

        public bool Function_执行对心()
        {
            if (!station_Param.是否对心._strParamVal)
            {
                return true;
            }
            StationStateHelper.OnTest_ShowStep(Name, $"{Name}:开始对心", LogType.Warn);
            if (sys.g_AppMode == AppMode.AirRun)
            {
                Thread.Sleep(300);
                return true;
            }
            double[] value = null;
            bool res = LoadSeverMgr.Instance.Function_对心( out value);
            if (!res)
            {
                LogHelper.OnTest_ShowLog("TCP交互信息", $"图像对心失败");
                return false;
            }
            LogHelper.OnTest_ShowLog("TCP交互信息", $"CX={value[0]},CY={value[1]}");
            int count = 0;
            int count1 = 0;
            while (Math.Abs(value[0]) > station_Param.d_对心最大偏差._strParamVal || Math.Abs(value[1]) > station_Param.d_对心最大偏差._strParamVal)
            {
                count++;
                LogHelper.OnTest_ShowLog(Name, $"第{count}次对心");
                if (!Function_对心(value[0], value[1]))
                {
                    return false;
                }
              
                Thread.Sleep(500);
                res = LoadSeverMgr.Instance.Function_对心( out value);
                if (!res)
                {
                    LogHelper.OnTest_ShowLog("TCP交互信息", $"图像对心失败");
                    return false;
                }
                LogHelper.OnTest_ShowLog("TCP交互信息", $"CX={value[0]},CY={value[1]}");
                if (count == 10 && count1 == 0)
                {
                    count1++;
                    count = 0;
                    }
                else if (count == 10 && count1 != 0)
                {
                    return false;
                }
            }
            testResult.Center_x.Value = value[0];
            testResult.Center_y.Value = value[1];
            StationStateHelper.OnTest_ShowStep(Name, $"{Name}:对心成功", LogType.Warn);
            LogHelper.OnTest_ShowLog(Name, $"对心成功");
            return true;
        }
        public bool Function_对心(double cx, double cy, bool bmanual = false)
        {
            double dx;
            double dy;
            if (!station_Param.X方向是否对称._strParamVal)
                dx = cx * station_Param.X_gain._strParamVal;
            else
                dx = -cx * station_Param.X_gain._strParamVal;

            if (!station_Param.Y方向是否对称._strParamVal)
                dy = cy * station_Param.Y_gain._strParamVal;
            else
                dy = -cy * station_Param.Y_gain._strParamVal;

            double d_TargetX = MotionMgr.GetInstace().GetAxisActPos(AxisU) + dx;
            double d_TagertY = MotionMgr.GetInstace().GetAxisActPos(AxisTx) + dy;
            LogHelper.OnTest_ShowLog(Name, $"对心： U轴目标位置：{d_TargetX},Tx轴目标位置：{d_TagertY}", LogType.Info);

            if (d_TargetX < station_Param.d_Tx轴负限._strParamVal || d_TargetX > station_Param.d_Tx轴正限._strParamVal )
            {
                StationStateHelper.OnTest_ShowStep(Name, $"Tx轴运动超出限制",LogType.Err);
                LogHelper.OnTest_ShowLog(Name,$"{ Name}:TX轴目标位置：{ d_TargetX}，超出轴运动限制【{ station_Param.d_Tx轴负限._strParamVal}】- 【{ station_Param.d_Tx轴正限._strParamVal}】", LogType.Err);
                return false;
            }
            if (d_TagertY < station_Param.d_Ty轴负限._strParamVal || d_TagertY > station_Param.d_Ty轴正限._strParamVal)
            {
                StationStateHelper.OnTest_ShowStep(Name, $"Ty轴运动超出限制", LogType.Err);
                LogHelper.OnTest_ShowLog(Name, $"{Name}:Ty轴目标位置：{d_TagertY}，超出轴运动限制【{station_Param.d_Ty轴负限._strParamVal}】- 【{station_Param.d_Ty轴正限._strParamVal}】", LogType.Err);

                return false;
            }
            MoveMulitAxisPosWaitInpos(new int[] { AxisU, AxisTx }, new double[] { d_TargetX, d_TagertY }, new double[] { (double)SpeedType.High, (double)SpeedType.High }, 0.1, bmanual, this);
            return true;
        }

        public bool Function_标定数据结果判定(double[] result, ref string strError)
        {
            if (result == null)
                return false;

            double[] resultData = new double[50];
            for (int i = 0; i < resultData.Length; i++)
            {
                if (result.Length > i)
                {
                    resultData[i] = result[i];
                }
                else
                    resultData[i] = 0;
            }
            switch (Param_System.Instance.标定算法类型._strParamVal)
            {
                case 0:
                    (testResult as ResultData).RMS_Mean.Value = resultData[0];
                    (testResult as ResultData).Cx.Value = resultData[1];
                    (testResult as ResultData).Cy.Value = resultData[2];
                    (testResult as ResultData).fx.Value = resultData[3];
                    (testResult as ResultData).fy.Value = resultData[4];
                    (testResult as ResultData).K0.Value = resultData[5];
                    (testResult as ResultData).K1.Value = resultData[6];
                    (testResult as ResultData).K2.Value = resultData[7];
                    // (testResult as ResultData).K3.Value = resultData[8];
                    (testResult as ResultData).P0.Value = resultData[8];
                    (testResult as ResultData).P1.Value = resultData[9];
                    (testResult as ResultData).RMS_Max.Value = resultData[10];
                    (testResult as ResultData).Coverage.Value = resultData[11];


                    break;
                case 1:
                    (testResult as ResultData1).RMS_Mean.Value = resultData[0];
                    (testResult as ResultData1).Cx.Value = resultData[1];
                    (testResult as ResultData1).Cy.Value = resultData[2];
                    (testResult as ResultData1).fx.Value = resultData[3];
                    (testResult as ResultData1).fy.Value = resultData[4];
                    (testResult as ResultData1).K0.Value = resultData[5];
                    (testResult as ResultData1).K1.Value = resultData[6];
                    (testResult as ResultData1).K2.Value = resultData[7];
                    (testResult as ResultData1).K3.Value = resultData[8];
                    (testResult as ResultData1).K4.Value = resultData[9];
                    (testResult as ResultData1).K5.Value = resultData[10];
                    (testResult as ResultData1).P0.Value = resultData[11];
                    (testResult as ResultData1).P1.Value = resultData[12];
                    (testResult as ResultData1).RMS_Max.Value = resultData[13];
                    (testResult as ResultData1).Coverage.Value = resultData[14];
                    break;
                case 2:
                    (testResult as ResultData2).RMS_Mean.Value = resultData[0]; ;
                    (testResult as ResultData2).Cx.Value = resultData[1];
                    (testResult as ResultData2).Cy.Value = resultData[2];
                    (testResult as ResultData2).fx.Value = resultData[3];
                    (testResult as ResultData2).fy.Value = resultData[4];
                    (testResult as ResultData2).K0.Value = resultData[5];
                    (testResult as ResultData2).K1.Value = resultData[6];
                    (testResult as ResultData2).K2.Value = resultData[7];
                    (testResult as ResultData2).K3.Value = resultData[8];
                    (testResult as ResultData2).RMS_Max.Value = resultData[9];
                    (testResult as ResultData2).Coverage.Value = resultData[10];

                    break;
                case 3:
                    (testResult as ResultData3).RMS_Mean.Value = resultData[0]; ;
                    (testResult as ResultData3).Cx.Value = resultData[1];
                    (testResult as ResultData3).Cy.Value = resultData[2];
                    (testResult as ResultData3).fx.Value = resultData[3];
                    (testResult as ResultData3).fy.Value = resultData[4];
                    (testResult as ResultData3).K0.Value = resultData[5];
                    (testResult as ResultData3).K1.Value = resultData[6];
                    (testResult as ResultData3).P0.Value = resultData[7];
                    (testResult as ResultData3).P1.Value = resultData[8];
                    (testResult as ResultData3).MeiXi.Value = resultData[9];
                    (testResult as ResultData3).RMS_Max.Value = resultData[10];
                    (testResult as ResultData3).Coverage.Value = resultData[11];
                    break;
                case 4:
                    (testResult as ResultData2).RMS_Mean.Value = resultData[0];
                    (testResult as ResultData2).Cx.Value = resultData[1];
                    (testResult as ResultData2).Cy.Value = resultData[2];
                    (testResult as ResultData2).fx.Value = resultData[3];
                    (testResult as ResultData2).fy.Value = resultData[4];
                    (testResult as ResultData2).K0.Value = resultData[5];
                    (testResult as ResultData2).K1.Value = resultData[6];
                    (testResult as ResultData2).K2.Value = resultData[7];
                    (testResult as ResultData2).K3.Value = resultData[8];
                    (testResult as ResultData2).RMS_Max.Value = resultData[9];
                    (testResult as ResultData2).Coverage.Value = resultData[10];
                    break;
                case 5:
                    (testResult as ResultData5).RMS_Mean.Value = resultData[0];
                    (testResult as ResultData5).Cx.Value = resultData[1];
                    (testResult as ResultData5).Cy.Value = resultData[2];
                    (testResult as ResultData5).PolyCoeffs1.Value = resultData[3];
                    (testResult as ResultData5).PolyCoeffs2.Value = resultData[4];
                    (testResult as ResultData5).PolyCoeffs3.Value = resultData[5];
                    (testResult as ResultData5).PolyCoeffs4.Value = resultData[6];
                    (testResult as ResultData5).PolyCoeffs5.Value = resultData[7];
                    (testResult as ResultData5).InvPoly1.Value = resultData[8];
                    (testResult as ResultData5).InvPoly2.Value = resultData[9];
                    (testResult as ResultData5).InvPoly3.Value = resultData[10];
                    (testResult as ResultData5).InvPoly4.Value = resultData[11];
                    (testResult as ResultData5).InvPoly5.Value = resultData[12];
                    (testResult as ResultData5).InvPoly6.Value = resultData[13];
                    (testResult as ResultData5).InvPoly7.Value = resultData[14];
                    (testResult as ResultData5).InvPoly8.Value = resultData[15];
                    (testResult as ResultData5).InvPoly9.Value = resultData[16];
                    (testResult as ResultData5).InvPoly10.Value = resultData[17];
                    (testResult as ResultData5).InvPoly11.Value = resultData[18];
                    (testResult as ResultData5).InvPoly12.Value = resultData[19];
                    (testResult as ResultData5).InvPoly13.Value = resultData[20];
                    (testResult as ResultData5).InvPoly14.Value = resultData[21];
                    (testResult as ResultData5).InvPoly15.Value = resultData[22];
                    (testResult as ResultData5).InvPoly16.Value = resultData[23];
                    (testResult as ResultData5).InvPoly17.Value = resultData[24];
                    (testResult as ResultData5).InvPoly18.Value = resultData[25];
                    (testResult as ResultData5).InvPoly19.Value = resultData[26];
                    (testResult as ResultData5).InvPoly20.Value = resultData[27];
                    (testResult as ResultData5).AffineParas1.Value = resultData[28];
                    (testResult as ResultData5).AffineParas2.Value = resultData[29];
                    (testResult as ResultData5).AffineParas3.Value = resultData[30];
                    (testResult as ResultData5).AffineParas4.Value = resultData[31];
                    (testResult as ResultData5).AffineParas5.Value = resultData[32];
                    (testResult as ResultData5).RMS_Max.Value = resultData[33];
                    (testResult as ResultData5).Coverage.Value = resultData[34];
                    break;
            }
            return Func_数据对比(testResult, ref strError);
        }

        public bool Func_数据对比<T>(T testData, ref string strError)
        {

            {
                //1.获取数据值的类型
                //2.看数据能否转为double或int型，能转就比较，不能上下限就/
                //3.再看上下限能否转为double或int型,能转就比较
                bool result = true;


                PropertyInfo[] spData = testData.GetType().GetProperties();
                Type type = testData.GetType();
                int row = -1;
                foreach (var sp in spData)
                {
                    if (sp.DeclaringType.Name == "ResultDataBase")
                    {
                        continue;
                    }
                    //获取点检数据
                    object obj = type.GetProperty(sp.Name).GetValue(testData, null);
                    TestInfo tempSp = obj as TestInfo;
                    double d_UpLimit = 0;
                    double d_DownLimit = 0;
                    int n_UpLimit = 0;
                    int n_DownLimit = 0;



                    row++;
                    //判断值类型及比较结果
                    bool re = true;
                    //测试内容

                    if (tempSp.Value.GetType() == typeof(double))
                    {
                        //上限比较
                        if (double.TryParse(tempSp.Max, out d_UpLimit))
                        {
                            re &= tempSp.Value <= d_UpLimit;
                        }
                        else if (int.TryParse(tempSp.Max, out n_UpLimit))
                        {
                            re &= tempSp.Value <= n_UpLimit;
                        }


                        //下限比较
                        if (double.TryParse(tempSp.Min, out d_DownLimit))
                        {
                            re &= tempSp.Value >= d_DownLimit;
                        }
                        else if (int.TryParse(tempSp.Min, out n_DownLimit))
                        {
                            re &= tempSp.Value >= n_DownLimit;
                        }


                    }
                    else if (tempSp.Value.GetType() == typeof(int))
                    {
                        //上限比较
                        if (double.TryParse(tempSp.Max, out d_UpLimit))
                        {
                            re &= tempSp.Value <= d_UpLimit;
                        }
                        else if (int.TryParse(tempSp.Max, out n_UpLimit))
                        {
                            re &= tempSp.Value <= n_UpLimit;
                        }

                        //下限比较
                        if (double.TryParse(tempSp.Min, out d_DownLimit))
                        {
                            re &= tempSp.Value >= d_DownLimit;
                        }
                        else if (int.TryParse(tempSp.Min, out n_DownLimit))
                        {
                            re &= tempSp.Value >= n_DownLimit;
                        }

                    }
                    else
                    {
                        //结果是bool型
                        if (tempSp.Value.GetType() == typeof(bool) && !tempSp.Value)
                            re = false;
                        else
                            re = true;


                    }
                    if (!re)
                    {
                        result = false;
                        strError = $"{tempSp.Name} 失败";
                        break;
                    }


                }

                return result;
            }

        }

        public void Function_设置标定参数规格(ref ResultDataBase resultData)
        {
           
            switch ( Param_System.Instance.标定算法类型._strParamVal)
            {
                case 0:
                    resultData = new ResultData();
                    (resultData as ResultData).RMS_Mean.Max = $"{ station_Param.平均重投影_MAX._strParamVal}";
                    (resultData as ResultData).RMS_Mean.Min = $"{ station_Param.平均重投影_MIN._strParamVal}";
                    (resultData as ResultData).RMS_Max.Max = $"{ station_Param.最大重投影_MAX._strParamVal}";
                    (resultData as ResultData).RMS_Max.Min = $"{ station_Param.最大重投影_MIN._strParamVal}";
                    (resultData as ResultData).Coverage.Max = $"{ station_Param.覆盖率_MAX._strParamVal}";
                    (resultData as ResultData).Coverage.Min = $"{ station_Param.覆盖率_MIN._strParamVal}";
                    (resultData as ResultData).Cx.Max = $"{ station_Param.Cx_Max._strParamVal}";
                    (resultData as ResultData).Cx.Min = $"{ station_Param.Cx_Min._strParamVal}";
                    (resultData as ResultData).Cy.Max = $"{ station_Param.Cy_Max._strParamVal}";
                    (resultData as ResultData).Cy.Min = $"{ station_Param.Cy_Min._strParamVal}";
                    (resultData as ResultData).fx.Max = $"{ station_Param.fx_Max._strParamVal}";
                    (resultData as ResultData).fx.Min = $"{ station_Param.fx_Min._strParamVal}";
                    (resultData as ResultData).fy.Max = $"{ station_Param.fy_Max._strParamVal}";
                    (resultData as ResultData).fy.Min = $"{ station_Param.fy_Min._strParamVal}";
                    (resultData as ResultData).K0.Max = $"{ station_Param.k0_Max._strParamVal}";
                    (resultData as ResultData).K0.Min = $"{ station_Param.k0_Min._strParamVal}";
                    (resultData as ResultData).K1.Max = $"{ station_Param.k1_Max._strParamVal}";
                    (resultData as ResultData).K1.Min = $"{ station_Param.k1_Min._strParamVal}";
                    (resultData as ResultData).K2.Max = $"{ station_Param.k2_Max._strParamVal}";
                    (resultData as ResultData).K2.Min = $"{ station_Param.k2_Min._strParamVal}";
                    //(resultData as ResultData).K3.Max = $"{ station_Param.k3_Max._strParamVal}";
                    //(resultData as ResultData).K3.Min = $"{ station_Param.k3_Min._strParamVal}";
                    (resultData as ResultData).P0.Max = $"{ station_Param.p0_Max._strParamVal}";
                    (resultData as ResultData).P0.Min = $"{ station_Param.p0_Min._strParamVal}";
                    (resultData as ResultData).P1.Max = $"{ station_Param.p1_Max._strParamVal}";
                    (resultData as ResultData).P1.Min = $"{ station_Param.p1_Min._strParamVal}";


                    break;
                case 1:
                    resultData = new ResultData1();
                    (resultData as ResultData1).RMS_Mean.Max = $"{ station_Param.平均重投影_MAX._strParamVal}";
                    (resultData as ResultData1).RMS_Mean.Min = $"{ station_Param.平均重投影_MIN._strParamVal}";
                    (resultData as ResultData1).RMS_Max.Max = $"{ station_Param.最大重投影_MAX._strParamVal}";
                    (resultData as ResultData1).RMS_Max.Min = $"{ station_Param.最大重投影_MIN._strParamVal}";
                    (resultData as ResultData1).Coverage.Max = $"{ station_Param.覆盖率_MAX._strParamVal}";
                    (resultData as ResultData1).Coverage.Min = $"{ station_Param.覆盖率_MIN._strParamVal}";
                    (resultData as ResultData1).Cx.Max = $"{ station_Param.Cx_Max._strParamVal}";
                    (resultData as ResultData1).Cx.Min = $"{ station_Param.Cx_Min._strParamVal}";
                    (resultData as ResultData1).Cy.Max = $"{ station_Param.Cy_Max._strParamVal}";
                    (resultData as ResultData1).Cy.Min = $"{ station_Param.Cy_Min._strParamVal}";
                    (resultData as ResultData1).fx.Max = $"{ station_Param.fx_Max._strParamVal}";
                    (resultData as ResultData1).fx.Min = $"{ station_Param.fx_Min._strParamVal}";
                    (resultData as ResultData1).fy.Max = $"{ station_Param.fy_Max._strParamVal}";
                    (resultData as ResultData1).fy.Min = $"{ station_Param.fy_Min._strParamVal}";
                    (resultData as ResultData1).K0.Max = $"{ station_Param.k0_Max._strParamVal}";
                    (resultData as ResultData1).K0.Min = $"{ station_Param.k0_Min._strParamVal}";
                    (resultData as ResultData1).K1.Max = $"{ station_Param.k1_Max._strParamVal}";
                    (resultData as ResultData1).K1.Min = $"{ station_Param.k1_Min._strParamVal}";
                    (resultData as ResultData1).K2.Max = $"{ station_Param.k2_Max._strParamVal}";
                    (resultData as ResultData1).K2.Min = $"{ station_Param.k2_Min._strParamVal}";
                    (resultData as ResultData1).K3.Max = $"{ station_Param.k3_Max._strParamVal}";
                    (resultData as ResultData1).K3.Min = $"{ station_Param.k3_Min._strParamVal}";
                    (resultData as ResultData1).K4.Max = $"{ station_Param.k4_Max._strParamVal}";
                    (resultData as ResultData1).K4.Min = $"{ station_Param.k4_Min._strParamVal}";
                    (resultData as ResultData1).K5.Max = $"{ station_Param.k5_Max._strParamVal}";
                    (resultData as ResultData1).K5.Min = $"{ station_Param.k5_Min._strParamVal}";
                    (resultData as ResultData1).P0.Max = $"{ station_Param.p0_Max._strParamVal}";
                    (resultData as ResultData1).P0.Min = $"{ station_Param.p0_Min._strParamVal}";
                    (resultData as ResultData1).P1.Max = $"{ station_Param.p1_Max._strParamVal}";
                    (resultData as ResultData1).P1.Min = $"{ station_Param.p1_Min._strParamVal}";



                    break;
                case 2:
                    resultData = new ResultData2();
                    (resultData as ResultData2).RMS_Mean.Max = $"{ station_Param.平均重投影_MAX._strParamVal}";
                    (resultData as ResultData2).RMS_Mean.Min = $"{ station_Param.平均重投影_MIN._strParamVal}";
                    (resultData as ResultData2).RMS_Max.Max = $"{ station_Param.最大重投影_MAX._strParamVal}";
                    (resultData as ResultData2).RMS_Max.Min = $"{ station_Param.最大重投影_MIN._strParamVal}";
                    (resultData as ResultData2).Coverage.Max = $"{ station_Param.覆盖率_MAX._strParamVal}";
                    (resultData as ResultData2).Coverage.Min = $"{ station_Param.覆盖率_MIN._strParamVal}";
                    (resultData as ResultData2).Cx.Max = $"{ station_Param.Cx_Max._strParamVal}";
                    (resultData as ResultData2).Cx.Min = $"{ station_Param.Cx_Min._strParamVal}";
                    (resultData as ResultData2).Cy.Max = $"{ station_Param.Cy_Max._strParamVal}";
                    (resultData as ResultData2).Cy.Min = $"{ station_Param.Cy_Min._strParamVal}";
                    (resultData as ResultData2).fx.Max = $"{ station_Param.fx_Max._strParamVal}";
                    (resultData as ResultData2).fx.Min = $"{ station_Param.fx_Min._strParamVal}";
                    (resultData as ResultData2).fy.Max = $"{ station_Param.fy_Max._strParamVal}";
                    (resultData as ResultData2).fy.Min = $"{ station_Param.fy_Min._strParamVal}";
                    (resultData as ResultData2).K0.Max = $"{ station_Param.k0_Max._strParamVal}";
                    (resultData as ResultData2).K0.Min = $"{ station_Param.k0_Min._strParamVal}";
                    (resultData as ResultData2).K1.Max = $"{ station_Param.k1_Max._strParamVal}";
                    (resultData as ResultData2).K1.Min = $"{ station_Param.k1_Min._strParamVal}";
                    (resultData as ResultData2).K2.Max = $"{ station_Param.k2_Max._strParamVal}";
                    (resultData as ResultData2).K2.Min = $"{ station_Param.k2_Min._strParamVal}";
                    (resultData as ResultData2).K3.Max = $"{ station_Param.k3_Max._strParamVal}";
                    (resultData as ResultData2).K3.Min = $"{ station_Param.k3_Min._strParamVal}";


                    break;
                case 3:
                    resultData = new ResultData3();
                    (resultData as ResultData3).RMS_Mean.Max = $"{ station_Param.平均重投影_MAX._strParamVal}";
                    (resultData as ResultData3).RMS_Mean.Min = $"{ station_Param.平均重投影_MIN._strParamVal}";
                    (resultData as ResultData3).RMS_Max.Max = $"{ station_Param.最大重投影_MAX._strParamVal}";
                    (resultData as ResultData3).RMS_Max.Min = $"{ station_Param.最大重投影_MIN._strParamVal}";
                    (resultData as ResultData3).Coverage.Max = $"{ station_Param.覆盖率_MAX._strParamVal}";
                    (resultData as ResultData3).Coverage.Min = $"{ station_Param.覆盖率_MIN._strParamVal}";
                    (resultData as ResultData3).Cx.Max = $"{ station_Param.Cx_Max._strParamVal}";
                    (resultData as ResultData3).Cx.Min = $"{ station_Param.Cx_Min._strParamVal}";
                    (resultData as ResultData3).Cy.Max = $"{ station_Param.Cy_Max._strParamVal}";
                    (resultData as ResultData3).Cy.Min = $"{ station_Param.Cy_Min._strParamVal}";
                    (resultData as ResultData3).fx.Max = $"{ station_Param.fx_Max._strParamVal}";
                    (resultData as ResultData3).fx.Min = $"{ station_Param.fx_Min._strParamVal}";
                    (resultData as ResultData3).fy.Max = $"{ station_Param.fy_Max._strParamVal}";
                    (resultData as ResultData3).fy.Min = $"{ station_Param.fy_Min._strParamVal}";
                    (resultData as ResultData3).K0.Max = $"{ station_Param.k0_Max._strParamVal}";
                    (resultData as ResultData3).K0.Min = $"{ station_Param.k0_Min._strParamVal}";
                    (resultData as ResultData3).K1.Max = $"{ station_Param.k1_Max._strParamVal}";
                    (resultData as ResultData3).K1.Min = $"{ station_Param.k1_Min._strParamVal}";
                    (resultData as ResultData3).P0.Max = $"{ station_Param.p0_Max._strParamVal}";
                    (resultData as ResultData3).P0.Min = $"{ station_Param.p0_Min._strParamVal}";
                    (resultData as ResultData3).P1.Max = $"{ station_Param.p1_Max._strParamVal}";
                    (resultData as ResultData3).P1.Min = $"{ station_Param.p1_Min._strParamVal}";




                    break;
                case 4:
                    resultData = new ResultData2();
                    (resultData as ResultData2).RMS_Mean.Max = $"{ station_Param.平均重投影_MAX._strParamVal}";
                    (resultData as ResultData2).RMS_Mean.Min = $"{ station_Param.平均重投影_MIN._strParamVal}";
                    (resultData as ResultData2).RMS_Max.Max = $"{ station_Param.最大重投影_MAX._strParamVal}";
                    (resultData as ResultData2).RMS_Max.Min = $"{ station_Param.最大重投影_MIN._strParamVal}";
                    (resultData as ResultData2).Coverage.Max = $"{ station_Param.覆盖率_MAX._strParamVal}";
                    (resultData as ResultData2).Coverage.Min = $"{ station_Param.覆盖率_MIN._strParamVal}";
                    (resultData as ResultData2).Cx.Max = $"{ station_Param.Cx_Max._strParamVal}";
                    (resultData as ResultData2).Cx.Min = $"{ station_Param.Cx_Min._strParamVal}";
                    (resultData as ResultData2).Cy.Max = $"{ station_Param.Cy_Max._strParamVal}";
                    (resultData as ResultData2).Cy.Min = $"{ station_Param.Cy_Min._strParamVal}";
                    (resultData as ResultData2).fx.Max = $"{ station_Param.fx_Max._strParamVal}";
                    (resultData as ResultData2).fx.Min = $"{ station_Param.fx_Min._strParamVal}";
                    (resultData as ResultData2).fy.Max = $"{ station_Param.fy_Max._strParamVal}";
                    (resultData as ResultData2).fy.Min = $"{ station_Param.fy_Min._strParamVal}";
                    (resultData as ResultData2).K0.Max = $"{ station_Param.k0_Max._strParamVal}";
                    (resultData as ResultData2).K0.Min = $"{ station_Param.k0_Min._strParamVal}";
                    (resultData as ResultData2).K1.Max = $"{ station_Param.k1_Max._strParamVal}";
                    (resultData as ResultData2).K1.Min = $"{ station_Param.k1_Min._strParamVal}";
                    (resultData as ResultData2).K2.Max = $"{ station_Param.k2_Max._strParamVal}";
                    (resultData as ResultData2).K2.Min = $"{ station_Param.k2_Min._strParamVal}";
                    (resultData as ResultData2).K3.Max = $"{ station_Param.k3_Max._strParamVal}";
                    (resultData as ResultData2).K3.Min = $"{ station_Param.k3_Min._strParamVal}";
                    break;
                case 5:
                    resultData = new ResultData5();
                    (resultData as ResultData5).RMS_Mean.Max = $"{ station_Param.平均重投影_MAX._strParamVal}";
                    (resultData as ResultData5).RMS_Mean.Min = $"{ station_Param.平均重投影_MIN._strParamVal}";
                    (resultData as ResultData5).RMS_Max.Max = $"{ station_Param.最大重投影_MAX._strParamVal}";
                    (resultData as ResultData5).RMS_Max.Min = $"{ station_Param.最大重投影_MIN._strParamVal}";
                    (resultData as ResultData5).Coverage.Max = $"{ station_Param.覆盖率_MAX._strParamVal}";
                    (resultData as ResultData5).Coverage.Min = $"{ station_Param.覆盖率_MIN._strParamVal}";
                    (resultData as ResultData5).Cx.Max = $"{ station_Param.Cx_Max._strParamVal}";
                    (resultData as ResultData5).Cx.Min = $"{ station_Param.Cx_Min._strParamVal}";
                    (resultData as ResultData5).Cy.Max = $"{ station_Param.Cy_Max._strParamVal}";
                    (resultData as ResultData5).Cy.Min = $"{ station_Param.Cy_Min._strParamVal}";

                    (resultData as ResultData5).PolyCoeffs1.Max = $"{ station_Param.PolyCoeffs1_Max._strParamVal}";
                    (resultData as ResultData5).PolyCoeffs1.Min = $"{ station_Param.PolyCoeffs1_Min._strParamVal}";
                    (resultData as ResultData5).PolyCoeffs2.Max = $"{ station_Param.PolyCoeffs2_Max._strParamVal}";
                    (resultData as ResultData5).PolyCoeffs2.Min = $"{ station_Param.PolyCoeffs2_Min._strParamVal}";
                    (resultData as ResultData5).PolyCoeffs3.Max = $"{ station_Param.PolyCoeffs3_Max._strParamVal}";
                    (resultData as ResultData5).PolyCoeffs3.Min = $"{ station_Param.PolyCoeffs3_Min._strParamVal}";
                    (resultData as ResultData5).PolyCoeffs4.Max = $"{ station_Param.PolyCoeffs4_Max._strParamVal}";
                    (resultData as ResultData5).PolyCoeffs4.Min = $"{ station_Param.PolyCoeffs4_Min._strParamVal}";
                    (resultData as ResultData5).PolyCoeffs5.Max = $"{ station_Param.PolyCoeffs5_Max._strParamVal}";
                    (resultData as ResultData5).PolyCoeffs5.Min = $"{ station_Param.PolyCoeffs5_Min._strParamVal}";

                    (resultData as ResultData5).InvPoly1.Max = $"{ station_Param.InvPoly1_Max._strParamVal}";
                    (resultData as ResultData5).InvPoly1.Min = $"{ station_Param.InvPoly1_Min._strParamVal}";
                    (resultData as ResultData5).InvPoly2.Max = $"{ station_Param.InvPoly2_Max._strParamVal}";
                    (resultData as ResultData5).InvPoly2.Min = $"{ station_Param.InvPoly2_Min._strParamVal}";
                    (resultData as ResultData5).InvPoly3.Max = $"{ station_Param.InvPoly3_Max._strParamVal}";
                    (resultData as ResultData5).InvPoly3.Min = $"{ station_Param.InvPoly3_Min._strParamVal}";
                    (resultData as ResultData5).InvPoly4.Max = $"{ station_Param.InvPoly4_Max._strParamVal}";
                    (resultData as ResultData5).InvPoly4.Min = $"{ station_Param.InvPoly4_Min._strParamVal}";
                    (resultData as ResultData5).InvPoly5.Max = $"{ station_Param.InvPoly5_Max._strParamVal}";
                    (resultData as ResultData5).InvPoly5.Min = $"{ station_Param.InvPoly5_Min._strParamVal}";
                    (resultData as ResultData5).InvPoly6.Max = $"{ station_Param.InvPoly6_Max._strParamVal}";
                    (resultData as ResultData5).InvPoly6.Min = $"{ station_Param.InvPoly6_Min._strParamVal}";
                    (resultData as ResultData5).InvPoly7.Max = $"{ station_Param.InvPoly7_Max._strParamVal}";
                    (resultData as ResultData5).InvPoly7.Min = $"{ station_Param.InvPoly7_Min._strParamVal}";
                    (resultData as ResultData5).InvPoly8.Max = $"{ station_Param.InvPoly8_Max._strParamVal}";
                    (resultData as ResultData5).InvPoly8.Min = $"{ station_Param.InvPoly8_Min._strParamVal}";
                    (resultData as ResultData5).InvPoly9.Max = $"{ station_Param.InvPoly9_Max._strParamVal}";
                    (resultData as ResultData5).InvPoly9.Min = $"{ station_Param.InvPoly9_Min._strParamVal}";
                    (resultData as ResultData5).InvPoly10.Max = $"{ station_Param.InvPoly10_Max._strParamVal}";
                    (resultData as ResultData5).InvPoly10.Min = $"{ station_Param.InvPoly10_Min._strParamVal}";


                    (resultData as ResultData5).InvPoly11.Max = $"{ station_Param.InvPoly11_Max._strParamVal}";
                    (resultData as ResultData5).InvPoly11.Min = $"{ station_Param.InvPoly11_Min._strParamVal}";
                    (resultData as ResultData5).InvPoly12.Max = $"{ station_Param.InvPoly12_Max._strParamVal}";
                    (resultData as ResultData5).InvPoly12.Min = $"{ station_Param.InvPoly12_Min._strParamVal}";
                    (resultData as ResultData5).InvPoly13.Max = $"{ station_Param.InvPoly13_Max._strParamVal}";
                    (resultData as ResultData5).InvPoly13.Min = $"{ station_Param.InvPoly13_Min._strParamVal}";
                    (resultData as ResultData5).InvPoly14.Max = $"{ station_Param.InvPoly14_Max._strParamVal}";
                    (resultData as ResultData5).InvPoly14.Min = $"{ station_Param.InvPoly14_Min._strParamVal}";
                    (resultData as ResultData5).InvPoly15.Max = $"{ station_Param.InvPoly15_Max._strParamVal}";
                    (resultData as ResultData5).InvPoly15.Min = $"{ station_Param.InvPoly15_Min._strParamVal}";
                    (resultData as ResultData5).InvPoly16.Max = $"{ station_Param.InvPoly16_Max._strParamVal}";
                    (resultData as ResultData5).InvPoly16.Min = $"{ station_Param.InvPoly16_Min._strParamVal}";
                    (resultData as ResultData5).InvPoly17.Max = $"{ station_Param.InvPoly17_Max._strParamVal}";
                    (resultData as ResultData5).InvPoly17.Min = $"{ station_Param.InvPoly17_Min._strParamVal}";
                    (resultData as ResultData5).InvPoly18.Max = $"{ station_Param.InvPoly18_Max._strParamVal}";
                    (resultData as ResultData5).InvPoly18.Min = $"{ station_Param.InvPoly18_Min._strParamVal}";
                    (resultData as ResultData5).InvPoly19.Max = $"{ station_Param.InvPoly19_Max._strParamVal}";
                    (resultData as ResultData5).InvPoly19.Min = $"{ station_Param.InvPoly19_Min._strParamVal}";
                    (resultData as ResultData5).InvPoly20.Max = $"{ station_Param.InvPoly20_Max._strParamVal}";
                    (resultData as ResultData5).InvPoly20.Min = $"{ station_Param.InvPoly20_Min._strParamVal}";



                    (resultData as ResultData5).AffineParas1.Max = $"{ station_Param.AffineParas1_Max._strParamVal}";
                    (resultData as ResultData5).AffineParas1.Min = $"{ station_Param.AffineParas1_Min._strParamVal}";
                    (resultData as ResultData5).AffineParas2.Max = $"{ station_Param.AffineParas2_Max._strParamVal}";
                    (resultData as ResultData5).AffineParas2.Min = $"{ station_Param.AffineParas2_Min._strParamVal}";
                    (resultData as ResultData5).AffineParas3.Max = $"{ station_Param.AffineParas3_Max._strParamVal}";
                    (resultData as ResultData5).AffineParas3.Min = $"{ station_Param.AffineParas3_Min._strParamVal}";
                    (resultData as ResultData5).AffineParas4.Max = $"{ station_Param.AffineParas4_Max._strParamVal}";
                    (resultData as ResultData5).AffineParas4.Min = $"{ station_Param.AffineParas4_Min._strParamVal}";
                    (resultData as ResultData5).AffineParas5.Max = $"{ station_Param.AffineParas5_Max._strParamVal}";
                    (resultData as ResultData5).AffineParas5.Min = $"{ station_Param.AffineParas5_Min._strParamVal}";

                    break;
            }

            resultData.str_机型.Value = Param_System.Instance.机型._strParamVal;
            resultData.str_批次.Value = Param_System.Instance.批次._strParamVal;
            resultData.str_操作者.Value = Param_System.Instance.操作者._strParamVal;
            resultData.str_设备编号.Value = Param_System.Instance.设备编号._strParamVal;
            resultData.str_工站编号.Value = Param_System.Instance.工站编号._strParamVal;

            resultData.Voltage.Max = $"{station_Param.d_Voltage_Max._strParamVal}";
            resultData.Voltage.Min = $"{station_Param.d_Voltage_Min._strParamVal}";

            resultData.Current.Max = $"{station_Param.d_Current_Max._strParamVal}";
            resultData.Current.Min = $"{station_Param.d_Current_Min._strParamVal}";


        }

        #endregion



    }
}
